UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VtaGNekl3CWxv+FpovYc4LPd3d48MOxux6epV04hIVU='
WHERE
key_id = 'df144dcfda846496b5af2055baff4e658ec0bb834bf73516e69ba40226793b56'
AND (
token = 'VtaGNekl3CWxv+FpovYc4LPd3d48MOxux6epV04hIVU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)