UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ssCcbRI2kCWFAW5ilq89QSCXkNeUy5P4/fKST/eqeMk=' 
WHERE 
  key_id = 'de2d1be7a316e61a6725d1d7878a846a0453e25d624bda2889da1bde01074e33' 
  AND (
    token = 'ssCcbRI2kCWFAW5ilq89QSCXkNeUy5P4/fKST/eqeMk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027