UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JG9XtcFwJB51pfEL12eB6UuoM1PEPr6a6Iaf4T92H+4='
WHERE
key_id = '56706ea48d2aef40170fd1122a887ff5390d8185ebd63f913775840ba7065468'
AND (
token = 'JG9XtcFwJB51pfEL12eB6UuoM1PEPr6a6Iaf4T92H+4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)