UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iJSAs7oPDGjDOaK1b5GMzV1DjMScLqshvSMi6cN/PXs='
WHERE
key_id = '37af9289c38420f354b4b3853e5dc7b9f3d07a47bc7be46980b649f3625ae6f6'
AND (
token = 'iJSAs7oPDGjDOaK1b5GMzV1DjMScLqshvSMi6cN/PXs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)