UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5IidoWO6GhkkFZd0B3Sm8qJkH5iWKgMBQ/YH7qAcqRA='
WHERE
key_id = '3b2e4f444c676081b8ce842d1ddbd8695e4fd71fc958a196ca0fc547caf30f0e'
AND (
token = '5IidoWO6GhkkFZd0B3Sm8qJkH5iWKgMBQ/YH7qAcqRA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)