UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kb2eGuWZHsUePJ6UYT8ea+1ehWuwyg2VAJcAOmIY3UY=' 
WHERE 
  key_id = '61156b28da29cc05b22603ac30b0cf72006b98a436e61549d08bcbcdaa139505' 
  AND (
    token = 'kb2eGuWZHsUePJ6UYT8ea+1ehWuwyg2VAJcAOmIY3UY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027