UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm7GjDzwpQwM5NBbOJEWVBfT/SPal9jBSD6gibggu1iM=' 
WHERE 
  key_id = '8694f9287d426e1f76ed9536ff444da34a5dbd83ce5a732f011bda5f0d8f4561' 
  AND (
    token = 'm7GjDzwpQwM5NBbOJEWVBfT/SPal9jBSD6gibggu1iM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030