UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FFCU1lswO40wAhEkE/koWBFBkIRhZaQCTp/ovQ1sNCc='
WHERE
key_id = '7ce4ffefa827626af2609f66606242606e622d36f0942cc6469fb45449bf61fb'
AND (
token = 'FFCU1lswO40wAhEkE/koWBFBkIRhZaQCTp/ovQ1sNCc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)