UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eDphnEe8WTsw9K8RaLD9PLvgrl7WQ3b6R65p+Ps6FYE=' 
WHERE 
  key_id = '984fc2d5c88eaed7feae282aa6b6889562283dcbab81f958ded89f1e628e0deb' 
  AND (
    token = 'eDphnEe8WTsw9K8RaLD9PLvgrl7WQ3b6R65p+Ps6FYE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029