UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D1RqMg83WrFx7Jqh/2/iZ6KDKeQnMPsHYunhwMiKxrg='
WHERE
key_id = '448d1f9d6cd42b91008ea2b56d7379e69fb52dec781b4bdcb72a4cef766c5319'
AND (
token = 'D1RqMg83WrFx7Jqh/2/iZ6KDKeQnMPsHYunhwMiKxrg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)