UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tjG/d0Z5WRx1AMrsnDUKjzqtkNTOx0A14PGTp12VaQc='
WHERE
key_id = '80c91750013587d58ff4f569a357d7ff601e1bc9631bc8d3e88f4a58364c344d'
AND (
token = 'tjG/d0Z5WRx1AMrsnDUKjzqtkNTOx0A14PGTp12VaQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)