UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'layPVOLJ4+CmD2V/ciTtCCNjyPeCmnWHGTYUCk62Mso='
WHERE
key_id = '52996277c1556630656ca7650285991198bc03e2785a33c328c995c1c5b646df'
AND (
token = 'layPVOLJ4+CmD2V/ciTtCCNjyPeCmnWHGTYUCk62Mso='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)