UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7YFOyaAZeaM+BL0eM9p7IkRqivRMaAhQmLj82FF4s8o='
WHERE
key_id = '69657d39fa4ab200aeadaf04e6e393e54c207fbb6e150816c30e0e471c151354'
AND (
token = '7YFOyaAZeaM+BL0eM9p7IkRqivRMaAhQmLj82FF4s8o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)