UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LzirT7EakDjnskItNeLeW/yIWHeqnK/7mV8STA9N9MU=' 
WHERE 
  key_id = 'c2041646b2e2da90daed765d1c9b4bfa008466ff92a9bdda0b2372304927c479' 
  AND (
    token = 'LzirT7EakDjnskItNeLeW/yIWHeqnK/7mV8STA9N9MU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040