UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dqcRi6K/jPIS2w5e8sTf6278QUE5LM0cFW+lWOwo5Dg='
WHERE
key_id = '16c0277be878d52c02b2b08cbaa4e2ad82c434bb93be9c5e4f9ba73afa542823'
AND (
token = 'dqcRi6K/jPIS2w5e8sTf6278QUE5LM0cFW+lWOwo5Dg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)