UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZJYmkiVSz8LmRycs5mu1vgJ9cDDHV+9IAS0/YFAVb38='
WHERE
key_id = 'e243c275d46c02194f634e4b634e42194ec2fde0fa868cc0a07810090b4fa814'
AND (
token = 'ZJYmkiVSz8LmRycs5mu1vgJ9cDDHV+9IAS0/YFAVb38='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)