UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zto2s13csiBzGJeJxZ4ZUi9rCM+dom8jjEb/KEe/Wbs='
WHERE
key_id = '1c5b8b8fc0365ace27c9467ca3e4395225a4ca1c15c6940e0cf42125a7d38a33'
AND (
token = 'zto2s13csiBzGJeJxZ4ZUi9rCM+dom8jjEb/KEe/Wbs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)