UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3Vn5RAaitOxPVd/yuZrtT0qaLCM2sOZ3BXXg4D8GuMI=' 
WHERE 
  key_id = '2cf9e6924b9ff20d09e6fb6a00bca0845952847ee4abd1a119418526629692d5' 
  AND (
    token = '3Vn5RAaitOxPVd/yuZrtT0qaLCM2sOZ3BXXg4D8GuMI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025