UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O8QZLo6us7/jimdd8zU/MTOTUGUbn+jbfQplrd1VScs='
WHERE
key_id = '61c27916ee86b952f04542c3a71f1671ca946feb07520a8fd51abfbfe8662b04'
AND (
token = 'O8QZLo6us7/jimdd8zU/MTOTUGUbn+jbfQplrd1VScs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)