UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xgppi/SjWUj0cLZiLyCgSNDPSAFpG6I3Ti8wX7cdqqw=' 
WHERE 
  key_id = 'eecaa8ac3c6f63e24bfbc9bdfab1a382d3572d9478d1f8424de3a8f7f988e8b2' 
  AND (
    token = 'Xgppi/SjWUj0cLZiLyCgSNDPSAFpG6I3Ti8wX7cdqqw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052