UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SRcbZWM6OKxEYeKa8Y5d3lSMINdDo4ohaCdd5DOT0aY=' 
WHERE 
  key_id = 'e8b4fe604e54b88f6d0e285c16ab858e9e0643de1f33e27c83b9baaabe45b270' 
  AND (
    token = 'SRcbZWM6OKxEYeKa8Y5d3lSMINdDo4ohaCdd5DOT0aY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051