UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0MPwi2BrX1moaXSe5/5exJDPC65ecL4Srfcew2tcNGo='
WHERE
key_id = '9287c38d8a9f1fbda738e3d07c44828a0bdc1d6e9602a8f7a824933faf32d21f'
AND (
token = '0MPwi2BrX1moaXSe5/5exJDPC65ecL4Srfcew2tcNGo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)