UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lY5WRsO/BIfbKve1YdwMRjObuQIXw27mhJa7FwgbLec=' 
WHERE 
  key_id = '2dfa81ca79272935c7de22180aee410b702f5f1feaa6c6aca846b8b61317c158' 
  AND (
    token = 'lY5WRsO/BIfbKve1YdwMRjObuQIXw27mhJa7FwgbLec=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046