UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lwP7DBIdiQ9De2ye8VLzVHKCvJuP7gO5ebGMSwkzaoI=' 
WHERE 
  key_id = 'c1b55057eb726425455d176a32d690d798f1e14ecaf5b21cdfd83e9361711db5' 
  AND (
    token = 'lwP7DBIdiQ9De2ye8VLzVHKCvJuP7gO5ebGMSwkzaoI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047