UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C0/mjamvPy2ppctYv0uCIkh0b+5TtpzBmVfY6hdaKwY='
WHERE
key_id = '610d5bb583ca23ae8a4a6927344b9c79f213704e24b2133e46aaffc52fe55739'
AND (
token = 'C0/mjamvPy2ppctYv0uCIkh0b+5TtpzBmVfY6hdaKwY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)