UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LsN9uxzBhOwDzSjPJJhvIabSdSGDdBykLqRL4Ki2fEQ='
WHERE
key_id = '4d8b82737133c7997facfb7bbac9cf12b7c67d63b544d7452e35432fe2b63aa4'
AND (
token = 'LsN9uxzBhOwDzSjPJJhvIabSdSGDdBykLqRL4Ki2fEQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)