UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hgMYF+BgvT9yRPOxIjNrre90OlSN3ex41ZGSh0txbOw=' 
WHERE 
  key_id = '4bd61b8423107e74b2d15f970314ebfe71bd4a4f915b58b00035794b43ccdb63' 
  AND (
    token = 'hgMYF+BgvT9yRPOxIjNrre90OlSN3ex41ZGSh0txbOw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029