UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'korSUZotSiwEfBzNlfTOMn30sj+Xmbzt3K8T3xuCbAQ=' 
WHERE 
  key_id = 'de9c91a5f1c4456fa8f3d2eb4fcef3c1cb422c118970c6e80c6ff41da7663cf2' 
  AND (
    token = 'korSUZotSiwEfBzNlfTOMn30sj+Xmbzt3K8T3xuCbAQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028