UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '95hsaofLiiBX7kn65chvX5U8Bdtkp1lWVqVrheNYIUQ=' 
WHERE 
  key_id = 'fc2d466b1333141bdf8bc79d5fbec08f8929dddf182876784272d0f707ff4fbf' 
  AND (
    token = '95hsaofLiiBX7kn65chvX5U8Bdtkp1lWVqVrheNYIUQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045