UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EWa6FnHL7ir5cLViPh87iKqGtoY/zYshoL6SkckkXhM='
WHERE
key_id = 'dfe4ef00572e0fc32db06173dab600eb656e0da55d6818ba3d52d149d94acde6'
AND (
token = 'EWa6FnHL7ir5cLViPh87iKqGtoY/zYshoL6SkckkXhM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)