UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q6D79/NRI2HXwIYPdo5/61F1r3V4DRfT3lUg+eyXSm4='
WHERE
key_id = 'e18df760fd9b41b340e465e6f4af50b4e989e1e1acb26e60cc37c5ee8dbaef32'
AND (
token = 'q6D79/NRI2HXwIYPdo5/61F1r3V4DRfT3lUg+eyXSm4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)