UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wXYJN3nal2KXIFaQ6+utzKPMaAA+6MI4NsiSmH1C4bo='
WHERE
key_id = 'ca63f8705a4fbb4b8d02b82954cc9dd61ce5c9c7580d3a3d6dcb73669b5eae11'
AND (
token = 'wXYJN3nal2KXIFaQ6+utzKPMaAA+6MI4NsiSmH1C4bo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)