UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bEUMusiEogP/ip9oXaYjw6wTQgm0ADjUylm+Yz1FmOA='
WHERE
key_id = 'fea67017629f9ba149f820a787cf1ab4bd8328a3cd18cce54804fb729d2681d0'
AND (
token = 'bEUMusiEogP/ip9oXaYjw6wTQgm0ADjUylm+Yz1FmOA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)