UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TKsj+RMqrOAgRyPMXdSaxaR6Hc60mGZUboOAn3rL/qE='
WHERE
key_id = '8ce83a3774246641a3d64fbbae0d6ed6d0ea4fe6630f835035947877b97d80e7'
AND (
token = 'TKsj+RMqrOAgRyPMXdSaxaR6Hc60mGZUboOAn3rL/qE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)