UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8t5An+KP3Xh8durLr6z50FHAFSkWpjpxTfKpkfR6jVc='
WHERE
key_id = '9b867de2a508ca04ac1a292b9471aa744cce97b2481fa0518cca6c92941c6ed1'
AND (
token = '8t5An+KP3Xh8durLr6z50FHAFSkWpjpxTfKpkfR6jVc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)